import serve from '../service.js'
import service from '../service.js'

//获取主页面初始项目
export function GetProjectInfo() {
    return serve({
        method: 'GET',
        url: 'user/all',
    })
}

//获取問題列表
export function getIssusByTeamAndType(data) {
    return serve({
        method: 'POST',
        url: 'issus/issusbyteam',
        data,
    })
}

//根據團隊获取所有項目
export function getProjectByTeam(data) {
    return service({
        method: 'POST',
        url: '/project/getProjectByTeam',
        data,
    })
}

//登录接口
export function Login(data) {
    return service({
        method: 'POST',
        url: '/user/login',
        data,
    })
}

//注册接口
export function Register(data) {
    return service({
        method: 'POST',
        url: '/user/register',
        data,
    })
}

// 更改问题状态
export function UpdataIssus(data) {
    return service({
        method: 'POST',
        url: '/issus/updata',
        data,
    })
}

// 搜索问题
export function SearchIssus(data) {
    return service({
        method: 'POST',
        url: '/issus/searchIssus',
        data,
    })
}

// // 根据用户userid获取与他相关联的团队id
// export function Register(data) {
//     return service({
//         method: 'POST',
//         url: '/user/register',
//         data,
//     })
// }












//搜索请求
export function getWorksKeyWords(keywords) {
    return serve({
        method: 'GET',
        url: '/home/getworksbykeywords' + '?keywords=' + keywords,
    })
}

//登出接口
export function logOut(userEmail) {
    return service({
        method: 'POST',
        url: '/home/logout',
        params: {
            useremail: userEmail,
        }
    })
}

export function signup(usereMail, userName, userPwd) {
    return service({
        method: 'POST',
        url: '/home/signin',
        params: {
            username: userName,
            userpwd: userPwd,
            useremail: usereMail
        }
    })
}
